#include "functional.h"
#include "iostream.h"
#include "map.h"

#include "map.c++"
#include "hoistbp.c++"

typedef map_value_type<int, char> pair_type;

static pair_type p1(3, 'c');
static pair_type p2(6, 'f');
static pair_type p3(1, 'a');
static pair_type p4(2, 'b');
static pair_type p5(3, 'x');
static pair_type p6(6, 'f');

typedef multimap<int, char, less<int> > mmap;

static map_value_type<int, char> array [] =
{
  p1,
  p2,
  p3,
  p4,
  p5,
  p6
};

int main()
{
  mmap m(array, array + 6);
  map_iterator<int, char, less<int> > i;

  i = m.lower_bound(3);
  cout << "lower bound:" << endl;
  cout <<(*i).first << " -> " <<(*i).second << endl;

  i = m.upper_bound(3);
  cout << "upper bound:" << endl;
  cout <<(*i).first << " -> " <<(*i).second << endl;
}
